package com.wits.qso.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.wits.platform.service.BaseService;
import com.wits.qso.dao.DiscussionMemberDao;
import com.wits.qso.entity.DiscussionMember;
import com.wits.qso.entity.DiscussionMemberPK;

@Component
public class DiscussionMemberService extends BaseService<DiscussionMember,DiscussionMemberPK>{

	private DiscussionMemberDao discussionMemberDao;

	@Resource
	public void setDiscussionMemberDao(DiscussionMemberDao discussionMemberDao) {
		this.baseDao= discussionMemberDao;
		this.discussionMemberDao = discussionMemberDao;
	}
	
	/**
	 * 
	 * 根据groupId查询该讨论组下的所有人员
	 * @param groupId
	 * @return
	 */
	public List<DiscussionMember> findByGroupId(String groupId){
		return discussionMemberDao.findMemberByGroupId(groupId);
	}
	
	/**
	 * 根据groupId查询该讨论组非指定status的人员,
	 * @param groupId
	 * @param status
	 * @return
	 */
	public List<DiscussionMember> findByGroupIdAndNotEqStatus(String groupId,int status){
		return discussionMemberDao.findByGroupIdAndNotEqStatus(groupId,status);
	}
	
	/**
	 * 根据groupId查询该讨论组非指定status的人员id,
	 * @param groupId
	 * @param status
	 * @return
	 */
	public List<String> findMemberIdByGroupIdAndNotEqStatus(String groupId,int status){
		return discussionMemberDao.findMemberIdByGroupIdAndNotEqStatus(groupId,status);
	}
	
	/**
	 * 根据讨论组Id查询该讨论组下的所有成员Id
	 * @param groupId
	 * @return
	 */
	public List<String> findMemberIdByGroupId(String groupId){
		return discussionMemberDao.findMemberIdByGroupId(groupId);
	}
	
	
}
